#pragma once
// -------------------------------------------------
// BlinKit - BlinKit Library
// -------------------------------------------------
//   File Name: tooltip.h
// Description: Tooltip Class
//      Author: Ziming Li
//     Created: 2022-04-17
// -------------------------------------------------
// Copyright (C) 2022 MingYang Software Technology.
// -------------------------------------------------

#ifndef BLINKIT_TOOLTIP_H
#define BLINKIT_TOOLTIP_H

#include <CommCtrl.h>
#include "blinkit/blink/renderer/platform/text/TextDirection.h"
#include "blinkit/blink/renderer/platform/Timer.h"

namespace BlinKit {

class Tooltip
{
public:
    Tooltip(HWND hParent);
    ~Tooltip(void);

    void Show(std::wstring &&text, TextDirection dir, unsigned long cookie);
    void Hide(void);

    bool ProcessShowNotify(HWND hWnd);
private:
    static HWND CreateTooltipWindow(HWND hParent);
    void TimerFired(Timer<Tooltip> *);

    HWND m_hWnd;

    Timer<Tooltip> m_timer;
    unsigned long m_cookie = 0;
    std::wstring m_text;
    UINT m_rtlFlag = 0;
};

} // namespace BlinKit

#endif // BLINKIT_TOOLTIP_H
